Buffer compare

Is it possible to get the difference of two buffers (as blue color for insertion and red color strikethrough for deletion) and send it to Word document.

Wanted help if the Buffer variable can be transferred a word document copy. I wanted to compare two objects and put the comparison report a word document.
Lion29 - Fri Jul 22 18:47:05 EDT 2011

Re: Buffer compare
Mathias Mamsch - Tue Jul 26 04:13:59 EDT 2011

Bringing colored richText to Microsoft Word is tricky for earlier DOORS versions. Since DOORS 9.2.1 there is the setRichClipWithColour function which will allow you to simply copy the richText with Color information to the clipboard and paste it to word. I am not sure if getting colors into a word document can be easily done. Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Buffer compare
llandale - Tue Jul 26 14:39:09 EDT 2011

The "diff" command will give you your difference markups; red-strikouts and blue-underscores by default. Put your from and your To text into buffers and call the command:

Buffer bufDiff = create()
Buffer bufFrom = create()
Buffer bufTo = create()
bufFrom = Old text
bufTo = new text
string ErrMess = diff(bufDiff, bufFrom, bufTo)
send bufDiff to MS-Word.

It does not seem reasonable to me to attempt to show these differences for two texts that contain rich text markup; e.g. if one has bold and the other italic or one has strikeouts; what would the difference look like? So if the text is in attributes retrieve it with "obj.NameAttr" instead of "richText(obj.NameAttr)". When in doubt you can convert it to raw text with "bufFrom = plainText(TextRich)".

My functions that do this work have mutated and been mung'd so much that I'm deeply suspicious there is a far simpler way of getting the difference into MS-Word. That, and long ago I settled into writing and closing a file and then openning that file with Word; whereas most folks here invoke Word and use OLE to send it stuff directly. I'm guessing:

(1) use the full RTF option in the command:
...string ErrMess = diff(bufDiff, bufFrom, bufTo, true)
(2) Take Mathias advise on tranfer to Word.

There may be a problem when the raw text contains these special characters: {}/.

  • Louie